<?php
/**
 * SBCategoryResponse
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API - Sponsored Brands
 *
 * Use the Amazon Ads API for Sponsored Brands for campaign, ad group, keyword, negative keyword, drafts, Stores, landing pages, and Brands management operations. For more information about Sponsored Brands, see the [Sponsored Brands Support Center](https://advertising.amazon.com/help#GQFZA83P55P747BZ). For onboarding information, see the [account setup](https://advertising.amazon.com/API/docs/v3/guides/account_setup) topic.
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * SBCategoryResponse Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class SBCategoryResponse implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'SBCategoryResponse';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'id' => 'int',
        'name' => 'string',
        'translated_name' => 'string',
        'is_targetable' => 'bool',
        'path' => 'string',
        'translated_path' => 'string',
        'estimated_reach' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'id' => 'int64',
        'name' => null,
        'translated_name' => null,
        'is_targetable' => null,
        'path' => null,
        'translated_path' => null,
        'estimated_reach' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'id' => 'id',
        'name' => 'name',
        'translated_name' => 'translatedName',
        'is_targetable' => 'isTargetable',
        'path' => 'path',
        'translated_path' => 'translatedPath',
        'estimated_reach' => 'estimatedReach'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'name' => 'setName',
        'translated_name' => 'setTranslatedName',
        'is_targetable' => 'setIsTargetable',
        'path' => 'setPath',
        'translated_path' => 'setTranslatedPath',
        'estimated_reach' => 'setEstimatedReach'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'name' => 'getName',
        'translated_name' => 'getTranslatedName',
        'is_targetable' => 'getIsTargetable',
        'path' => 'getPath',
        'translated_path' => 'getTranslatedPath',
        'estimated_reach' => 'getEstimatedReach'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['id'] = isset($data['id']) ? $data['id'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['translated_name'] = isset($data['translated_name']) ? $data['translated_name'] : null;
        $this->container['is_targetable'] = isset($data['is_targetable']) ? $data['is_targetable'] : null;
        $this->container['path'] = isset($data['path']) ? $data['path'] : null;
        $this->container['translated_path'] = isset($data['translated_path']) ? $data['translated_path'] : null;
        $this->container['estimated_reach'] = isset($data['estimated_reach']) ? $data['estimated_reach'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets id
     *
     * @return int
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param int $id The category identifier.
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets name
     *
     * @return string
     */
    public function getName()
    {
        return $this->container['name'];
    }

    /**
     * Sets name
     *
     * @param string $name The category name.
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets translated_name
     *
     * @return string
     */
    public function getTranslatedName()
    {
        return $this->container['translated_name'];
    }

    /**
     * Sets translated_name
     *
     * @param string $translated_name The category name translated to the specified locale in the request.
     *
     * @return $this
     */
    public function setTranslatedName($translated_name)
    {
        $this->container['translated_name'] = $translated_name;

        return $this;
    }

    /**
     * Gets is_targetable
     *
     * @return bool
     */
    public function getIsTargetable()
    {
        return $this->container['is_targetable'];
    }

    /**
     * Sets is_targetable
     *
     * @param bool $is_targetable Set to `true` if the category can be targeted in a targeting expression, and `false` if not.
     *
     * @return $this
     */
    public function setIsTargetable($is_targetable)
    {
        $this->container['is_targetable'] = $is_targetable;

        return $this;
    }

    /**
     * Gets path
     *
     * @return string
     */
    public function getPath()
    {
        return $this->container['path'];
    }

    /**
     * Sets path
     *
     * @param string $path The path of the category within the category catalogue.
     *
     * @return $this
     */
    public function setPath($path)
    {
        $this->container['path'] = $path;

        return $this;
    }

    /**
     * Gets translated_path
     *
     * @return string
     */
    public function getTranslatedPath()
    {
        return $this->container['translated_path'];
    }

    /**
     * Sets translated_path
     *
     * @param string $translated_path The path of the category within the category catalogue translated to the specified locale in the request.
     *
     * @return $this
     */
    public function setTranslatedPath($translated_path)
    {
        $this->container['translated_path'] = $translated_path;

        return $this;
    }

    /**
     * Gets estimated_reach
     *
     * @return string
     */
    public function getEstimatedReach()
    {
        return $this->container['estimated_reach'];
    }

    /**
     * Sets estimated_reach
     *
     * @param string $estimated_reach The estimated daily reach range of the category. Only set when supply source is `STREAMING_VIDEO`
     *
     * @return $this
     */
    public function setEstimatedReach($estimated_reach)
    {
        $this->container['estimated_reach'] = $estimated_reach;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
